﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DelonixRegiaHotel
{
    public partial class Rates : System.Web.UI.Page
    {
        static float a, c, d;

        static char b;

        protected void Page_Load(object sender, EventArgs e)
        {

        }
       protected void btn1_Click(object sender, EventArgs e)
    {

        if ((tbxDisplay.Text == "+") || (tbxDisplay.Text == "-") || (tbxDisplay.Text == "*") || (tbxDisplay.Text == "/"))
        {

            tbxDisplay.Text = "";

            tbxDisplay.Text = tbxDisplay.Text + btn1.Text;

        }

        else

            tbxDisplay.Text = tbxDisplay.Text + btn1.Text;

    }

    protected void btn2_Click(object sender, EventArgs e)
    {

        if ((tbxDisplay.Text == "+") || (tbxDisplay.Text == "-") || (tbxDisplay.Text == "*") || (tbxDisplay.Text == "/"))
        {

            tbxDisplay.Text = "";

            tbxDisplay.Text = tbxDisplay.Text + btn2.Text;

        }

        else

            tbxDisplay.Text = tbxDisplay.Text + btn2.Text;

    }

    protected void btn3_Click(object sender, EventArgs e)
    {

        if ((tbxDisplay.Text == "+") || (tbxDisplay.Text == "-") || (tbxDisplay.Text == "*") || (tbxDisplay.Text == "/"))
        {

            tbxDisplay.Text = "";

            tbxDisplay.Text = tbxDisplay.Text + btn3.Text;

        }

        else

            tbxDisplay.Text = tbxDisplay.Text + btn3.Text;

    }

    protected void btn4_Click(object sender, EventArgs e)
    {

        if ((tbxDisplay.Text == "+") || (tbxDisplay.Text == "-") || (tbxDisplay.Text == "*") || (tbxDisplay.Text == "/"))
        {

            tbxDisplay.Text = "";

            tbxDisplay.Text = tbxDisplay.Text + btn4.Text;

        }

        else

            tbxDisplay.Text = tbxDisplay.Text + btn4.Text;

    }

    protected void btn5_Click(object sender, EventArgs e)
    {

        if ((tbxDisplay.Text == "+") || (tbxDisplay.Text == "-") || (tbxDisplay.Text == "*") || (tbxDisplay.Text == "/"))
        {

            tbxDisplay.Text = "";

            tbxDisplay.Text = tbxDisplay.Text + btn5.Text;

        }

        else

            tbxDisplay.Text = tbxDisplay.Text + btn5.Text;

    }

    protected void btn6_Click(object sender, EventArgs e)
    {

        if ((tbxDisplay.Text == "+") || (tbxDisplay.Text == "-") || (tbxDisplay.Text == "*") || (tbxDisplay.Text == "/"))
        {

            tbxDisplay.Text = "";

            tbxDisplay.Text = tbxDisplay.Text + btn6.Text;

        }

        else

            tbxDisplay.Text = tbxDisplay.Text + btn6.Text;

    }

    protected void btn7_Click(object sender, EventArgs e)
    {

        if ((tbxDisplay.Text == "+") || (tbxDisplay.Text == "-") || (tbxDisplay.Text == "*") || (tbxDisplay.Text == "/"))
        {

            tbxDisplay.Text = "";

            tbxDisplay.Text = tbxDisplay.Text + btn7.Text;

        }

        else

            tbxDisplay.Text = tbxDisplay.Text + btn7.Text;

    }



    protected void btn8_Click(object sender, EventArgs e)
    {

        if ((tbxDisplay.Text == "+") || (tbxDisplay.Text == "-") || (tbxDisplay.Text == "*") || (tbxDisplay.Text == "/"))
        {

            tbxDisplay.Text = "";

            tbxDisplay.Text = tbxDisplay.Text + btn8.Text;

        }

        else

            tbxDisplay.Text = tbxDisplay.Text + btn8.Text;

    }



    protected void btn9_Click(object sender, EventArgs e)
    {

        if ((tbxDisplay.Text == "+") || (tbxDisplay.Text == "-") || (tbxDisplay.Text == "*") || (tbxDisplay.Text == "/"))
        {

            tbxDisplay.Text = "";

            tbxDisplay.Text = tbxDisplay.Text + btn9.Text;

        }

        else

            tbxDisplay.Text = tbxDisplay.Text + btn9.Text;

    }



    protected void btn0_Click(object sender, EventArgs e)
    {

        if ((tbxDisplay.Text == "+") || (tbxDisplay.Text == "-") || (tbxDisplay.Text == "*") || (tbxDisplay.Text == "/"))
        {

            tbxDisplay.Text = "";

            tbxDisplay.Text = tbxDisplay.Text + btn0.Text;

        }

        else

            tbxDisplay.Text = tbxDisplay.Text + btn0.Text;

    }



    protected void btnAdd_Click(object sender, EventArgs e)
    {

        a = Convert.ToInt32(tbxDisplay.Text);

        tbxDisplay.Text = "";

        b = '+';

        tbxDisplay.Text += b;

    }

    protected void btnSubtract_Click(object sender, EventArgs e)
    {

        a = Convert.ToInt32(tbxDisplay.Text);

        tbxDisplay.Text = "";

        b = '-';

        tbxDisplay.Text += b;

    }

    protected void btnMultiply_Click(object sender, EventArgs e)
    {

        a = Convert.ToInt32(tbxDisplay.Text);

        tbxDisplay.Text = "";

        b = '*';

        tbxDisplay.Text += b;

    }

    protected void btnDivide_Click(object sender, EventArgs e)
    {

        a = Convert.ToInt32(tbxDisplay.Text);

        tbxDisplay.Text = "";

        b = '/';

        tbxDisplay.Text += b;

    }

    protected void btnEqual_Click(object sender, EventArgs e)
    {

        c = Convert.ToInt32(tbxDisplay.Text);

        tbxDisplay.Text = "";

        if (b == '/')
        {

            d = a / c;

            tbxDisplay.Text += d;

            a = d;

        }

        else if (b == '+')
        {

            d = a + c;

            tbxDisplay.Text += d;

            a = d;

        }

        else if (b == '-')
        {

            d = a - c;

            tbxDisplay.Text += d;

            a = d;

        }

        else
        {

            d = a * c;

            tbxDisplay.Text += d;

            a = d;

        }



    }


    protected void btnClear_Click(object sender, EventArgs e)
    {

        tbxDisplay.Text = "";

    }

        protected void btnAdmin_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/Admin.aspx");
        }

        protected void btnCheckIn_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/CheckIn.aspx");
        }

        protected void btnCheckOut_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/CheckOut.aspx");
        }

        protected void btnQuery_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/Query.aspx");
        }

        protected void btnBooking_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/RoomAvailability.aspx");
        }

        protected void btnRates_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/Rates.aspx");
        }

        protected void btnStaff_Click(object sender, ImageClickEventArgs e)
        {

        }

        protected void btnReport_Click(object sender, ImageClickEventArgs e)
        {

        }

        protected void btnLogout_Click(object sender, ImageClickEventArgs e)
        {

        }

        protected void btnLogo_Click(object sender, ImageClickEventArgs e)
        {

        }
    }
}